<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('服务商钱包明细列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            出款流水号:
                            <input type="text" name="profitSerial"/>
                        </li>
                        <li>
                            服务商编号:
                            <input type="text" name="agentNum"/>
                        </li>
                        <li>
                            状态：
                            <select name="status" >
                                <option value="">选择状态</option>
                                <option value="0">待处理</option>
                                <option value="1">成功</option>
                                <option value="2">失败</option>
                            </select>
                        </li>
                        <li>
                            类型：
                            <select name="type" th:with="type=${@dict.getType('tx_type')}">
                                <option value="">请选择</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
                        <li class="select-time">
                            <label>交易时间： </label>
                            <input type="text" class="time-input" id="startTime" th:value="${beginTime}" placeholder="开始时间" name="params[beginTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" th:value="${endTime}" placeholder="结束时间" name="params[endTime]"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <!--<div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="walletDetails:walletDetails:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="walletDetails:walletDetails:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="walletDetails:walletDetails:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="walletDetails:walletDetails:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>-->
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" class="table text-nowrap"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var orderState = [[${@dict.getType('orderState')}]];
    var merType = [[${@dict.getType('merType')}]];
    var editFlag = [[${@permission.hasPermi('walletDetails:walletDetails:edit')}]];
    var removeFlag = [[${@permission.hasPermi('walletDetails:walletDetails:remove')}]];
    var prefix = ctx + "walletDetails/walletDetails";

    var txTypeDatas = [[${@dict.getType('tx_type')}]];


    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "服务商钱包明细",
            columns: [
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'profitSerial',
                    title: '出款流水号'
                },
                {
                    field: 'agentNum',
                    title: '服务商编号'
                },
                {
                    field: 'amount',
                    title: '提现金额',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'dzAmount',
                    title: '到账金额',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'serviceCharge',
                    title: '手续费',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'status',
                    title: '状态',
                    formatter: function (value, row, index) {
                        if (value == '0') {
                            return '<span class="label label-success">待处理</span>';
                        } else if (value == '1') {
                            return '<span class="label label-success">成功</span>';
                        } else if (value == '2') {
                            return '<span class="label label-danger">失败</span>';
                        } else {
                            return '<span style="color: red">未知</span>';
                        }
                    },
                },
                {
                    field: 'type',
                    title: '类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(txTypeDatas, value);
                    },
                },
                {
                    field: 'remarks',
                    title: '备注信息'
                },
                {
                    field: 'createTime',
                    title: '交易时间'
                },
                {
                    field: 'accountType',
                    title: '账户类型',
                    formatter: function (value, row, index) {
                        if (value == '0'){
                            return "代理";
                        } else if (value == '1'){
                            return "商户";
                        } else if (value == '99'){
                            return "返现2";
                        } else if (value == '98'){
                            return "分润2";
                        }
                    }
                },
                {
                    field: 'merType',
                    title: '终端类型',
                    formatter: function (value, row, index) {
                        if (value == '0'){
                            return "传统";
                        } else if (value == '1'){
                            return "MPOS";
                        } else if (value == '4'){
                            return "电签";
                        }
                    }
                },
                {
                    field: 'acType',
                    title: '账户类型',
                    formatter: function (value, row, index) {
                        if (value == '1'){
                            return "分润";
                        } else if (value == '2'){
                            return "返现";
                        } else if (value == '3'){
                            return "通讯费返现";
                        } else if (value == '4'){
                            return "服务费返现";
                        }
                    }
                },
                /*{
                    field: 'numName',
                    title: '所属资深总监编号',
                    formatter: function(value,row,index){
                        var split = '';
                        if ($.common.isNotEmpty(value)){
                            split = value.split(",")[0];
                        }
                        return split;
                    }
                },
                {
                    field: 'numName',
                    title: '所属资深总监名称',
                    formatter: function(value,row,index){
                        var split1 = '';
                        if ($.common.isNotEmpty(value)){
                            split1 = value.split(",")[1];
                        }
                        return split1;
                    }
                }*/
                /* {
                     title: '操作',
                     align: 'center',
                     formatter: function(value, row, index) {
                         var actions = [];
                         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                         return actions.join('');
                     }
                 }*/]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
